package com.Iconcat.system.service;

import com.Iconcat.system.entity.CatUser;
import com.Iconcat.system.response.Result;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Page;

import java.math.BigDecimal;

public interface CatUserService extends IService<CatUser> {
    IPage<CatUser> userAll(Page<CatUser> page, @Param(Constants.WRAPPER) QueryWrapper<CatUser> wrapper);

    boolean isUserExists(String phoneNumber);
    Result deductBalance(Integer userId, BigDecimal deductAmount,String paymentPassword);
    void clearTotalEarnings(Integer userId);
    void addBalance(Integer userId, BigDecimal totalEarnings);
}
